package cn.sofwin.boot.crud.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.beans.factory.annotation.Autowired;
import cn.sofwin.core.mvc.bean.Meta;
import cn.sofwin.core.mvc.annotation.BaseDao;
import cn.sofwin.core.mvc.service.impl.BaseServiceImpl;
import cn.sofwin.boot.crud.entity.BaArtical;
import cn.sofwin.boot.crud.dao.BaArticalDao;
import cn.sofwin.boot.crud.service.BaArticalService;

/**
 * 服务层
 * @author LetCode
 * @since 1.0
 *
 */
@CacheConfig(cacheNames = "baArtical")
@Service("baArticalService")
public class BaArticalServiceImpl extends BaseServiceImpl<BaArtical> implements BaArticalService {
	
	@BaseDao
	@Autowired
	BaArticalDao baArticalDao;

	@Cacheable
	@Override
	public Meta loadMetaInfo(){
		Meta meta = new Meta("", "baArtical");

		// 增加表头字段信息
		meta.addColumn("id", "序号")
		      .addColumn("userId", "发布人id")
		      .addColumn("title", "标题")
		      .addColumn("summary", "摘要")
		      .addColumn("content", "内容")
		      .addColumn("count", "阅读计数(热点)")
		      .addColumn("addTime", "添加时间")
		      .addColumn("status", "状态：-1删除，0冻结，1正常");

		return meta;
	}

	
}